package com.zengzhi.mydesignmode.observermode.javaobservermode;

/**
 * @author xiejiawei
 * @Date 2021-08-16
 * @Time 22:12
 *  测试类
 */
public class WeatherStation {

    public static void main (String[] args){
        WeatherData weatherData = new WeatherData();

        CurrentConditionsDisplay currentConditionsDisplay = new CurrentConditionsDisplay(weatherData);
        StatisticsDisplay statisticsDisplay = new StatisticsDisplay(weatherData);
        ForecastDisplay forecastDisplay = new ForecastDisplay(weatherData);

        HeatIndexDisplay heatIndexDisplay = new HeatIndexDisplay(weatherData);
        weatherData.setMeasurements(80, 65, 30.4f);
        weatherData.setMeasurements(82, 70, 29.2f);
        weatherData.setMeasurements(78, 90, 29.2f);

        weatherData.deleteObserver(forecastDisplay);
        weatherData.setMeasurements(62, 90, 28.1f);

    }
}
